import 'package:floor/floor.dart';

@entity
class GroupEntity {
  @primaryKey
   int? id;

   String? uuid;

   int? createAt;

   int? userId;

   int? hostId;

   String? name;

   String? notice;

  GroupEntity(this.id, this.uuid, this.createAt, this.hostId, this.name, this.notice);

  GroupEntity.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    uuid = json['uuid'];
    createAt = json['createAt'];
    userId = json['userId'];
    name = json['name'];
    notice = json['notice'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['uuid'] = this.uuid;
    data['createAt'] = this.createAt;
    data['userId'] = this.userId;
    data['name'] = this.name;
    data['notice'] = this.notice;
    return data;
  }

  static List<GroupEntity> fromJsonList(List<dynamic> jsonList) {
    return jsonList.map((json) => GroupEntity.fromJson(json)).toList();
  }
}